from random import *

ls = sample(range(1, 34), 8)  # 中奖号码
print(ls)
s = input("enter a list of numbers separated by commas:")  # string
l = s.split(",")  # list
n = [int(x) for x in l]  # 用户猜的号码
print(n)

set_c = set(n) & set(ls)  # 取交集
list_c = list(set_c)

print("你中奖的数字有{}".format(list_c))

# (8-len(list_c)为错的个数
if ((8 - len(list_c)) == 0):
    print("一等奖")
if ((8 - len(list_c)) == 1):
    print("二等奖")
if ((8 - len(list_c)) == 2):
    print("三等奖")
if ((8 - len(list_c)) == 3):
    print("四等奖")
if ((8 - len(list_c)) >= 4):
    print("没奖哦")
